// import requestConfig from '@/config/requestConfig'

// const { request } = requestConfig

export const getOrderList = (params: any) => {
  return request({
    url: 'pzTask/pageList',
    method: 'get',
    data: params,
  })
}

// 完成服务确认
export const completeTask = (data) => uni.http({
  url: 'pzTaskOrder/completeConfirm',
  method: 'post',
  data,
  requestType:'company',
  noAuth: false
})

// 获取取消订单类型列表
export const getCancelOrderTypeList = () => uni.http({
  url: 'pzCommon/categoryTree',
  method: 'get',
  data: {
    type: 2
  },
  requestType:'company',
  noAuth: false
})


// 获取取消订单规则列表
export const getCancelRuleTypeList = () => uni.http({
  url: 'pzCommon/compensateRules',
  method: 'get',
  data: {
    type: 2
  },
  requestType:'company',
  noAuth: false
})

// 取消订单
export const cancelOrder = (data) => uni.http({
  url: 'pzTaskOrder/cancel',
  method: 'post',
  data,
  requestType:'company',
  noAuth: false
})

// 立即支付
export const payOrder = (data) => uni.http({
  url: 'pz_task/startBuyOrder',
  method: 'get',
  data:{
    ...data,
    is_app:1,
    platform:'app',
  },
  requestType:'company'
})

// 获取订单信息
export const getOrderInfo = (data) => uni.http({
  url: 'wechat_pay/index',
  method: 'get',
  data,
  requestType:'company',
  noAuth: false
})

// 取消支付
export const cancelPay = (data) => uni.http({
  url: 'wechat_pay/cancel',
  method: 'post',
  data,
  requestType:'company',
  noAuth: false
})

// 获取二维码
export const getQrCode = (data) => uni.http({
  url: 'pzTaskOrder/getQrcode',
  method: 'get',
  data,
  requestType:'company',
  noAuth: false
})
// 添加地址
export const addLocation = (data) => uni.http({
  url: 'pzTask/addLocation',
  method: 'post',
  data,
  requestType:'company',
  noAuth: false
})
// 评价
export const addComment = (params) => uni.http({
  url: 'pzTaskOrder/evaluation',
  method: 'post',
  requestType:'company',
  data: params,
})

export const getCommentInfo = (params) =>uni.http({
 url: 'pzTaskOrder/evaluation',
 method: 'get',
 requestType:'company',
 data: params,
})

// 获取订单详情信息
export const getOrderDetail = (data) => uni.http({
  url: 'pzTaskOrder/getInfo',
  method: 'get',
  data,
  requestType:'company',
})

// 获取金额状态
export const getMoneyStatus = (data) => uni.http({
  url: 'pzTask/getMoneyStatus',
  method: 'get',
  data,
  requestType:'company',
  noAuth: false
})

// 获取退款详情
export const getRefundDetail = (params) =>uni.http({
  url: 'pzTask/dispute',
  method: 'get',
  data: params,
  requestType:'company',
})

// 进行退款
export const refundMoney = (params) => uni.http({
  url: 'pzTaskOrder/dispute',
  method: 'post',
  data: params,
  requestType:'company',
})
// 需求列表
export const pageList = (params) => uni.http({
  url: 'pzTaskOrder/pageList',
  method: 'get',
  data: params,
  requestType:'company',
})
// 平台接入-举证提交
export const disputeInterfere = (params) => uni.http({
  url: 'pzTaskOrder/disputeInterfere',
  method: 'post',
  data: params,
  requestType:'company',
})
// 售后退款-申请
export const fefundFun = (params) => uni.http({
  url: 'pzTaskOrder/dispute',
  method: 'post',
  data: params,
  requestType:'company',
})
// 平台介入记录
export const disputeLog = (params) => uni.http({
  url: 'pzTaskOrder/disputeLog',
  method: 'post',
  data: params,
  requestType:'company',
})
// 需求补交-生成订单
export const confirmPay = (data) => uni.http({
  url: 'pzTaskOrder/confirm',
  method: 'get',
  data,
  requestType:'company',
  noAuth: false
})
// 需求补交-支付信息
export const confirmPayInfo = (data) => uni.http({
  url: 'wechat_pay/index',
  method: 'get',
  data,
  requestType:'company',
  noAuth: false
})
// 获取余额信息
export const userBalance = (params) => uni.http({
  url: 'pzTaskOrder/userBalance',
  method: 'get',
  data: params,
  requestType:'company',
})
// 拒绝确认
export const confirmRefuse = (params) => uni.http({
    url: 'pzTaskOrder/confirmRefuse',
    method: 'post',
    data: params,
    requestType:'company',
})

// 支付宝支付
export const getAlipayInfo = (data) => uni.http({
  url: 'alipay/alipay',
  method: 'get',
  data,
  requestType:'company',
  noAuth: false
})
// 微信支付
export const getWxpayInfo = (data) => uni.http({
  url: 'wechat_pay/index',
  method: 'get',
  data,
  requestType:'company',
  noAuth: false
})
// 余额支付
export const getBalancePay = (data) => uni.http({
  url: 'balancePay/pay',
  method: 'get',
  data,
  requestType:'company',
  noAuth: false
})


// 微信支付
export const toWechatPay = (data) =>
uni.http({
  url: 'wechat_app_pay/wx_app_pay',
  method: 'post',
  data,
  requestType: 'company',
})
